package com.atguigu.gulimall.order.dao;

import com.atguigu.gulimall.order.entity.OrderEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 订单
 * 
 * @author xiaolei
 * @email qingyulei@yeah.net
 * @date 2020-08-23 00:15:39
 */
@Mapper
public interface OrderDao extends BaseMapper<OrderEntity> {

    @Update("UPDATE oms_order\n" +
            "        SET `status` = #{code},modify_time = NOW(),pay_type = #{payType},payment_time = NOW()\n" +
            "        WHERE order_sn = #{orderSn}")
    void updateOrderStatus(@Param("orderSn") String orderSn,
                           @Param("code") Integer code,
                           @Param("payType") Integer payType);
}
